//
//  LogiticsHeaderView.m
//  NewPro
//
//  Created by RYX on 2018/10/23.
//  Copyright © 2018年 何荧红. All rights reserved.
//

#import "LogiticsHeaderView.h"

@implementation LogiticsHeaderView

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = UIColor.whiteColor;
        [self setUI];
    }
    return self;
}

- (void)setUI{
    
    UIFont *font = [UIFont systemFontOfSize:12];
    UIColor *color = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0];
    
    UILabel *la1 = [[UILabel alloc] init];
    la1.font = font;
    la1.textColor = color;
    la1.text = @"运单编号：";
    [self addSubview:la1];
    
    UILabel *la2 = [[UILabel alloc] init];
    la2.font = [UIFont systemFontOfSize:12];
    la2.text = @"承运人：";
    la2.font = font;
    la2.textColor = color;
    [self addSubview:la2];
    
    UILabel *numLa = [[UILabel alloc] init];
    self.numLa = numLa;
    numLa.font = font;
    numLa.textColor = color;
    [self addSubview:numLa];
    
    UILabel *nameLa = [[UILabel alloc] init];
    self.nameLa = nameLa;
    nameLa.font = font;
    nameLa.textColor = color;
    [self addSubview:nameLa];
    
    UIView *bottomView = [[UIView alloc] init];
    bottomView.backgroundColor = BASECOLOR;
    [self addSubview:bottomView];
    
    [la1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(14);
        make.top.mas_equalTo(14);
        make.height.mas_equalTo(12);
    }];
    
    [la2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(la1.mas_left);
        make.top.equalTo(la1.mas_bottom).offset(10);
        make.height.mas_equalTo(12);
    }];
    
    [numLa mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(la1.mas_right);
        make.centerY.equalTo(la1);
    }];
    
    [nameLa mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(la2.mas_right);
        make.centerY.equalTo(la2);
    }];
    
    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.right.bottom.equalTo(self);
        make.height.mas_equalTo(10);
    }];
    
}

@end
